home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / T-TPUG Old Monthly Disks / (c)ta.d64 / math whiz.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  2KB  |  78 lines

  1. 1 PRINT"[147]"
  2. 2 POKE53280,0:POKE53281,0
  3. 10 PRINTTAB(12)"MATH WHIZ"
  4. 20 PRINT"1 -- ADDITION             "
  5. 30 PRINT"2 -- SUBTRACTION          "
  6. 40 PRINT"3 -- MULTIPLICATION       "
  7. 50 PRINT"4 -- DIVISION             "
  8. 60 PRINT"5 -- MULTIPLICATION TABLES"
  9. 70 PRINT"6 -- END PROGRAM          "
  10. 75 PRINT:PRINT:INPUT"SELECT 1-6 ONLY";N
  11. 80 IFN>6THEN75
  12. 90 ONNGOTO200,300,400,500,800,1000
  13. 200 PRINT"[147]":CLR
  14. 201 PRINTTAB(11)"ADDITION PRACTICE"
  15. 210 GOSUB700
  16. 220 GOSUB720
  17. 230 PRINT:PRINTX;"+";Y;"=":INPUTA
  18. 240 Z=X+Y
  19. 250 IFA=ZTHENPRINT"CORRECT !!!":C=C+1:P=P+1:GOTO270
  20. 260 PRINT"WRONG."
  21. 262 PRINT"THE ANSWER WAS ";Z:P=P+1
  22. 270 IFR=PTHENPRINT"YOU GOT "C;" OUT OF "R;" RIGHT":GOSUB740
  23. 280 GOTO220
  24. 300 PRINT"[147]":CLR
  25. 301 PRINTTAB(11)"SUBTRACTION PRACTICE":CLR
  26. 310 GOSUB700
  27. 320 GOSUB720
  28. 330 PRINT:PRINTX;"-";Y;"=?":INPUTA
  29. 340 Z=X-Y
  30. 350 IFA=ZTHENPRINT"CORRECT !!!":C=C+1:P=P+1:GOTO370
  31. 360 PRINT"WRONG."
  32. 362 PRINT"THE ANSWER WAS ";Z:P=P+1
  33. 370 IFR=PTHENPRINT"YOU GOT "C;" OUT OF "R;" RIGHT":GOSUB740
  34. 380 GOTO320
  35. 400 PRINT"[147]":CLR
  36. 401 PRINTTAB(9)"MULTIPLICATION PRACTICE"
  37. 410 GOSUB700
  38. 420 GOSUB720
  39. 430 PRINT:PRINTX;"*";Y;"=?":PRINT
  40. 440 INPUT"YOUR ANSWER=";A:Z=X*Y
  41. 450 IFA=ZTHENPRINT"CORRECT":C=C+1:P=P+1:GOTO470
  42. 460 PRINT"WRONG."
  43. 462 PRINT"THE ANSWER WAS ";Z:P=P+1
  44. 470 IFR=PTHENPRINT"YOU GOT "C;" OUT OF "R;" RIGHT":GOSUB740
  45. 480 GOTO420
  46. 500 PRINT"[147]":CLR
  47. 501 PRINTTAB(11)"DIVISION PRACTICE"
  48. 510 GOSUB700
  49. 520 GOSUB720
  50. 525 IFX<YTHENGOTO520
  51. 530 PRINT:PRINTX;"/";Y;"=?":PRINT
  52. 550 Z=INT(X/Y):M=X-Z*Y
  53. 560 PRINT:INPUT"QUOTIENT=";Q
  54. 570 PRINT:INPUT"REMAINDER=";D
  55. 580 IFQ=ZANDD=MTHENPRINT"CORRECT":C=C+1:P=P+1:GOTO600
  56. 590 PRINT"WRONG."
  57. 592 PRINT"THE QUOTIENT WAS ";Z
  58. 594 PRINT"THE REMAINDER WAS ";M:P=P+1
  59. 600 IFR=PTHENPRINT"YOU GOT "C;" OUT OF "R;" RIGHT":GOSUB740
  60. 610 GOTO520
  61. 700 INPUT"HIGHEST NUMBER";H
  62. 710 INPUT"NUMBER OF PROBLEMS";R:RETURN
  63. 720 X=INT(H*RND(1))+1:Y=INT(H*RND(1))+1
  64. 730 RETURN
  65. 740 PRINT:INPUT"STUDY SOME MORE(Y/N)";A$
  66. 750 IFA$="Y"THENGOTO1
  67. 760 PRINT:PRINT"BYE BYE "
  68. 770 END
  69. 800 PRINT"[147]":CLR
  70. 801 PRINTTAB(9)"MULTIPLICATION TABLES":CLR
  71. 810 INPUT"MULTIPLIER TO STUDY";M
  72. 820 FORT=1TO10
  73. 830 D=T*M
  74. 840 PRINTT;" * "M;"=";D:PRINT
  75. 850 NEXTT
  76. 860 GOSUB740
  77. 1000 END
  78.